import { GameMain } from 'egret/workbench/electron-browser/game/gameMain';
import { getStartConfig } from 'egret/platform/environment/common/args';

/**
 * 
 */
function main() {
	const main = new GameMain();
	main.startup(getStartConfig()).then(() => {
		console.log("game preload done");
	}, error => {
		if (error.stack) {
			console.log(error.stack);
		}
	});
}

// preload 启动时window.location.search可能为空导致getStartConfig获取不了参数;
// 全局断点调试无效，临时方案;
// 游戏立即调用electronAPI可能为空，实际表现底层目前按序加载 preloadjs在最前面;
setTimeout(main, 0);
